package com.kfyty.loveqq.framework.boot.web.example.config;

import com.kfyty.loveqq.framework.core.autoconfig.annotation.Component;
import com.kfyty.loveqq.framework.web.core.filter.Filter;
import com.kfyty.loveqq.framework.web.core.http.ServerRequest;
import com.kfyty.loveqq.framework.web.core.http.ServerResponse;
import lombok.extern.slf4j.Slf4j;

/**
 * 描述:
 *
 * @author kfyty725
 * @date 2024/8/2 17:07
 * @email kfyty725@hotmail.com
 */
@Slf4j
@Component
public class LogWebFilter implements Filter {

    @Override
    public Continue doFilter(ServerRequest request, ServerResponse response) {
        log.info("start log filter: URI: {}", request.getRequestURI());
        return Continue.ofTrue(() -> log.info("end log filter: URI: {}", request.getRequestURI()));
    }
}
